<!DOCTYPE html>
<html>
<head>
    <title>JS数组</title>
    <meta charset="utf-8"/>
    <script src="../../js/jquery-1.10.1.min.js"></script>
    <script>
        //vt. 拼接；接合；使结婚
        //n. 接合；结婚
        var arr = [1,2,3,4,5];
        arr.splice(1, 0, 8, 9)
        alert(arr);
        //slice:vt. 切下；把…分成部分；将…切成薄片
        //vi. 切开；割破
        var colors = ["red", "green", "blue", "yellow", "purple"];
        var colors2 = colors.slice(1);
        var colors3 = colors.slice(1, 4);
        alert("colors2： " + colors2);
        alert("colors3： " + colors3); //green, blue, yellow
//        alert(arr.splice(0, 3));
//        var delArr = arr.splice(0, 2);
//        alert(delArr);
//        alert("arr:" + arr);
//        alert(arr.splice(1,2,3,4,5));
//        alert(arr);
    </script>
</head>
<body>
    <p>JS数组</p>
</body>
</html>